using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using Dapper.Contrib.Extensions;
using Publicuse.Entity.AttributeUtil;
using SqlSugar;

namespace Publicuse.Entity
{
  /// <summary>
  /// 日志管理
  /// </summary>
  [DBTable("`geeker-log`", "日志信息")]
  [Table("`geeker-log`")]
  [SugarTable("`geeker-log`")]
  public partial class Log : BaseModel<long>
  {
    [Remark("模块")]
    [EqueryQuery]
    public string lmodule { get; set; }

    [Remark("操作人")]
    public string luser { get; set; }

    [Remark("操作角色")]
    public string lrole { get; set; }

    [Remark("操作类型")]
    public string ltype { get; set; }

    [Remark("操作结果")]
    public int lsuccess { get; set; } = -1;

    [Remark("操作内容")]
    public string lcontent { get; set; }

    [Remark("IP地址")]
    public string ipaddress { get; set; }

    public Log()
    {
      this.Id = 0;
    }
  }

  /// <summary>
  /// 日志查询参数
  /// </summary>
  public class LogQuery : CommonQuery
  {
    public int lId { get; set; }
    public string lmodule { get; set; }

    public string lcontent { get; set; }

    public string luser { get; set; }

    public int lsuccess { get; set; }

    public string ltype { get; set; }

    public string lTime { get; set; }

    public LogQuery()
    {
      this.exportName = GetExportName;
    }

    public static string GetExportName
    {
      get { return "log"; }
    }
  }
}
